package com.xuecheng.content.convert;

import com.xuecheng.api.content.model.dto.CourseBaseDTO;
import com.xuecheng.api.content.model.vo.CourseAuditVO;
import com.xuecheng.api.content.model.vo.CourseBaseVo;
import com.xuecheng.content.entity.CourseBase;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author wz
 * @description:
 * @date 2021-12-08
 */
@Mapper
public interface CourseBaseConvert {

    CourseBaseConvert INSTANCE = Mappers.getMapper(CourseBaseConvert.class);

    @Mappings({
            @Mapping(source = "id", target = "courseBaseId")
    })
    CourseBaseDTO entity2dto(CourseBase courseBase);

    @Mappings({
            @Mapping(source = "courseBaseId", target = "id")
    })
    CourseBase dto2entity(CourseBaseDTO dto);

    List<CourseBaseDTO> entitys2dtos(List<CourseBase> courseBases);

    CourseBaseDTO vo2dto(CourseBaseVo courseBaseVo);

    CourseBaseDTO audit2dto(CourseAuditVO courseAuditVO);
}
